Only shorten the label if it actually overlaps the resize grip.
authorMatthias Clasen <mclasen@redhat.com>
Wed, 10 Nov 2004 15:32:19 +0000 (15:32 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 10 Nov 2004 15:32:19 +0000 (15:32 +0000)
2004-11-10  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only
shorten the label if it actually overlaps the resize grip.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkstatusbar.c

index 869257f36cda36bbdad9b822a333c15a111746a9..37313d3fbe88c795eed11b5f788f3dc116e7d6d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-11-10  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only
+       shorten the label if it actually overlaps the resize grip.
+
        * gdk/linux-fb/*: Fix many sparse warnings.  (#157253,
        Kjartan Maraas.
        
index 869257f36cda36bbdad9b822a333c15a111746a9..37313d3fbe88c795eed11b5f788f3dc116e7d6d8 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-10  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only
+       shorten the label if it actually overlaps the resize grip.
+
        * gdk/linux-fb/*: Fix many sparse warnings.  (#157253,
        Kjartan Maraas.
        
index 869257f36cda36bbdad9b822a333c15a111746a9..37313d3fbe88c795eed11b5f788f3dc116e7d6d8 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-10  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only
+       shorten the label if it actually overlaps the resize grip.
+
        * gdk/linux-fb/*: Fix many sparse warnings.  (#157253,
        Kjartan Maraas.
        
index 869257f36cda36bbdad9b822a333c15a111746a9..37313d3fbe88c795eed11b5f788f3dc116e7d6d8 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-10  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstatusbar.c (gtk_statusbar_size_allocate): Only
+       shorten the label if it actually overlaps the resize grip.
+
        * gdk/linux-fb/*: Fix many sparse warnings.  (#157253,
        Kjartan Maraas.
        
index aa41ce2c9c3775c369bc4e02d1ba8ca8cc62d8d0..0844335f6c6c6a342e8ec747dee57024b0b01f66 100644 (file)
@@ -776,7 +776,7 @@ gtk_statusbar_size_allocate  (GtkWidget     *widget,
 
   if (statusbar->has_resize_grip && statusbar->grip_window)
     {
-      GdkRectangle rect;
+      GdkRectangle rect, overlap;
       GtkAllocation allocation;
       
       get_grip_rect (statusbar, &rect);
@@ -787,11 +787,14 @@ gtk_statusbar_size_allocate  (GtkWidget     *widget,
                              rect.width, rect.height);
       
       allocation = statusbar->label->allocation;
-      allocation.width -= rect.width;
-      if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) 
-       allocation.x += rect.width;
-
-      gtk_widget_size_allocate (statusbar->label, &allocation);
+      if (gdk_rectangle_intersect (&rect, &allocation, &overlap))
+      {
+       allocation.width -= rect.width;
+       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) 
+         allocation.x += rect.width;
+       
+       gtk_widget_size_allocate (statusbar->label, &allocation);
+      }
     }
 }